/**
 * 
 */
package com.an.springbean;

import java.beans.PropertyDescriptor;

import org.springframework.beans.BeansException;
import org.springframework.beans.PropertyValues;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;

/**
 * @author 86171
 * quan全局级Bean处理器
 */
public class MyInstantiationAwareBeanPostProcessor extends InstantiationAwareBeanPostProcessorAdapter {

	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {

		if("car".equals(beanName)) {
			System.out.println("postProcessBeforeInitialization bean实例化前调用，仅对car进行处理");
		}
		return null;
	}
	
	@Override
	public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {

		if("car".equals(beanName)) {
			System.out.println("postProcessAfterInstantiation");
		}
	return true;
	}
	
	@Override
	public PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean,
			String beanName) throws BeansException {

		if("car".equals(beanName)) {
			System.out.println("postProcessPropertyValues");
		}
		
		return pvs;
	}
}
